package com.producerTest;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest
@RunWith(SpringRunner.class)
public class ProducerTest01 {

    //注入RabbitTemplate

    @Autowired
    private RabbitTemplate template;

    @Test
    public void testSend(){
        template.convertAndSend("bootExchange1","","hello boot direct mq20231107");
    }

}
